zbiór obserwacji uporządkowanych w czasie
\[X_t=f(X_1,...,X_{n-a})+\color{brown}{Z_t}\]
\[X_{10}=\phi_1 \color{red}{X_{9}}+\phi_2 \color{red}{X_{8}}+\phi_3 \color{red}{X_{7}}+Z_{10}=\\=1.1 \color{red}{X_{9}}+-0.7 \color{red}{X_{8}}+0.5 \color{red}{X_{7}}+Z_{10}=\color{green}{0.0995571}+Z_{10}\]
\[X_{10}=\theta_1 \color{red}{Z_{9}}+\theta_2 \color{red}{Z_{8}}+\theta_3 \color{red}{Z_{7}}+Z_{10}=\\=-1.5 \color{red}{Z_{9}}+0.4 \color{red}{Z_{8}}+-0.2 \color{red}{Z_{7}}+Z_{10}=\\=\color{green}{-1.0991499}+Z_{10}\]
\[X_t=\\ \color{red}{\theta_1 Z_{t-1}+\theta_2 Z_{t-2}+...+\theta_q Z_{t-q}}+\\ +\color{green}{\phi_1 X_{t-1} + \phi_2 X_{t-2}+...+\phi_p X_{t-p}}+\\ +\color{blue}{Z_t}\]
np. \[\color{green}{AR(p = 2)} + \color{red}{MA(q=1)}\] \[X_t=\color{red}{\theta_1 Z_{t-1}}+\color{green}{\phi_1 X_{t-1} + \phi_2 X_{t-2}}+\color{blue}{Z_t}\]
\[\triangledown X_t=X_t-X_{t-1}\]
model = auto.arima(series, max.p = 5, max.q = 5, stationary = TRUE) model = Arima(series, order=c(3,0,2)) plot(series)
model$coef
## ar1 ar2 ar3 ma1 ma2 intercept ## 1.0628518 -0.6672928 0.4864164 0.5400869 -0.3832765 0.3051114
model$sigma2
## [1] 0.2494025
model$aicc
## [1] 2911.481
model$bic
## [1] 2950.631
plot(model$residuals)
hist(model$residuals, breaks=25)
hist(model$residuals, breaks=25)
\[X_t = \color{red}{ARIMA(p,d,q)} + f(\color{green}{X_{t-s},X_{t-2s},X_{t-3s},X_{t-4s}})\]
np. SARIMA(1,0,2)(2,0,1)[12] \[X_t = \\\phi_1X_{t-1}+\theta_1Z_{t-1}+\theta_2Z_{t-2}+\\+\Phi_1X_{t-s}+\Phi_2X_{t-2s}+\Theta_1Z_{t-s}\\+Z_t\]
ARIMA(3,0,0) + diff(lag=12) = SARIMA(3,0,0)(0,1,0)[12]
model1 = auto.arima(seasonal_time_series, seasonal=TRUE)
model2 = Arima(seasonal_time_series, order=c(3,0,0),
seasonal=list(order=c(2,1,2), period=12))
model$coef
## ar1 ar2 ma1 ma2 sar1 sma1 ## 0.6539013 -0.4540754 -0.7255744 0.2532569 -0.2427082 -0.8451177
model$sigma2
## [1] 0.4075656
forecast_length = period include_previous_length = period*5 forecasted = forecast(model, forecast_length) plot(forecasted, include_previous_length)
#period = 288 #sampling = 10 #y = ts(..., f=period*sampling) model = Arima(y, order=c(2,0,1), xreg=fourier(y,K=1)) model$coef
## ar1 ar2 ma1 intercept S1-2880 ## 0.867612763 -0.170287114 0.228848076 -0.005962361 0.411032413 ## C1-2880 ## 0.025343092
xreg może być dowolną funkcją, np. prostokątną
podatny na efekt Gibbsa
f = as.formula('Y~D1+D2+D3+D4+D5+DS1_1+DS1_2+DS1_3+DS2_1+DS2_2+DS2_3')
nn = neuralnet(f,data=train_set,hidden=c(11))